#ifndef _TBLIST_H_
#define _TBLIST_H_

namespace tb
{

	template <typename T, unsigned int Size>
	class List
	{
	
	public:
	
		List();
		~List();

		T& operator [] (unsigned int a_Index);
		const T& operator [] (unsigned int a_Index) const;

		// Empty list, without deleting items
		List<T, Size>& Empty();

		// Check if list is empty
		bool CheckEmpty() const;

		// Delete all items
		List<T, Size>& Clear();

		T& GetTop();
		const T& GetTop() const;
		T& GetBottom();
		const T& GetBottom() const;

		List<T, Size>& Next();
		List<T, Size>& Previous();

		unsigned int GetSize() const;
		unsigned int GetMaximum() const;
	
		// Make room for a_Count items
		List<T, Size>& Reserve(unsigned int a_Count);
		
		// Guarantee that at least a_Count more items fit
		List<T, Size>& Guarantee(unsigned int a_Count);

		List<T, Size>& Push(const T& a_Element);
		T& Pop();

	protected:

		void _Resize(unsigned int a_Count);

		unsigned int m_Offset;
		unsigned int m_Maximum;

		T* m_Memory;
		T m_Pool[Size];
	
	}; // class List

}; // namespace tb

#include "TBList.inl"
	
#endif